#include "AudioSystem.h"
#include <fstream>
using namespace std;

int main()
{
       AudioSystem as;

       char* buffer = (char*)malloc(100000);
       /*ifstream ifs("test.wav", ios_base::in | ios_base::binary);
       if(!ifs)
       {
               cout << "file not found";
               exit(1);
       }
       ifs.seekg(0, ios::beg);*/
	   cout << "recorder starts" << endl;
	   as.recorder(buffer, 100000);
	   cout << "recorder finishes" << endl;
       while(1)
       {
               /*ifs.read(buffer, 1024);
               int bytesRead = ifs.gcount();*/
			   as.playBuffer(buffer, 100000);
				/*if (ifs.eof())
                       break;*/
       }
       getchar();
}